<?php

namespace Budget\BudgetBundle\Entity;

use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 * @ORM\Table(name="fos_user")
 */
class User extends BaseUser
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;
    
    /**
     * @ORM\ManyToOne(targetEntity="Family", inversedBy="users")
     * @ORM\JoinColumn(name="family_id", referencedColumnName="id")
     */
    protected $family;

    /**
     * @ORM\OneToMany(targetEntity="Expense", mappedBy="user")
     */
    protected $expenses;
    
     /**
     * @ORM\OneToMany(targetEntity="Income", mappedBy="user")
     */
    protected $incomes;
    
    /**
     * @ORM\OneToMany(targetEntity="PlannedExpense", mappedBy="user")
     */
    protected $planned_expenses;
     
    /**
     * @Assert\NotBlank(message="Please enter your surname.", groups={"Registration", "Profile"})
     * @ORM\Column(type="string", length=50)
     */
    protected $surname;
    
    public function __construct()
    {
        parent::__construct();
        // your own logic
    }   
    
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set family
     *
     * @param integer $family
     * @return User
     */
    public function setFamily($family)
    {
        $this->family = $family;

        return $this;
    }

    /**
     * Get family
     *
     * @return family 
     */
    public function getFamily()
    {
        return $this->family;
    }

    /**
     * Add expenses
     *
     * @param \Budget\BudgetBundle\Entity\Expense $expenses
     * @return User
     */
    public function addExpense(\Budget\BudgetBundle\Entity\Expense $expenses)
    {
        $this->expenses[] = $expenses;

        return $this;
    }

    /**
     * Remove expenses
     *
     * @param \Budget\BudgetBundle\Entity\Expense $expenses
     */
    public function removeExpense(\Budget\BudgetBundle\Entity\Expense $expenses)
    {
        $this->expenses->removeElement($expenses);
    }

    /**
     * Get expenses
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getExpenses()
    {
        return $this->expenses;
    }

    /**
     * Add category
     *
     * @param \Budget\BudgetBundle\Entity\Category $category
     * @return User
     */
    public function addCategory(\Budget\BudgetBundle\Entity\Category $category)
    {
        $this->category[] = $category;

        return $this;
    }

    /**
     * Remove category
     *
     * @param \Budget\BudgetBundle\Entity\Category $category
     */
    public function removeCategory(\Budget\BudgetBundle\Entity\Category $category)
    {
        $this->category->removeElement($category);
    }

    /**
     * Get category
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getCategory()
    {
        return $this->category;
    }

    /**
     * Get expense
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getExpense()
    {
        return $this->expense;
    }

    /**
     * Set surname
     *
     * @param string $surname
     * @return User
     */
    public function setSurname($surname)
    {
        $this->surname = $surname;

        return $this;
    }

    /**
     * Get surname
     *
     * @return string 
     */
    public function getSurname()
    {
        return $this->surname;
    }

    /**
     * Add incomes
     *
     * @param \Budget\BudgetBundle\Entity\Income $incomes
     * @return User
     */
    public function addIncome(\Budget\BudgetBundle\Entity\Income $incomes)
    {
        $this->incomes[] = $incomes;

        return $this;
    }

    /**
     * Remove incomes
     *
     * @param \Budget\BudgetBundle\Entity\Income $incomes
     */
    public function removeIncome(\Budget\BudgetBundle\Entity\Income $incomes)
    {
        $this->incomes->removeElement($incomes);
    }

    /**
     * Get incomes
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getIncomes()
    {
        return $this->incomes;
    }

    /**
     * Get income
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getIncome()
    {
        return $this->income;
    }

    /**
     * Add planned_expenses
     *
     * @param \Budget\BudgetBundle\Entity\PlannedExpense $plannedExpenses
     * @return User
     */
    public function addPlannedExpense(\Budget\BudgetBundle\Entity\PlannedExpense $plannedExpenses)
    {
        $this->planned_expenses[] = $plannedExpenses;

        return $this;
    }

    /**
     * Remove planned_expenses
     *
     * @param \Budget\BudgetBundle\Entity\PlannedExpense $plannedExpenses
     */
    public function removePlannedExpense(\Budget\BudgetBundle\Entity\PlannedExpense $plannedExpenses)
    {
        $this->planned_expenses->removeElement($plannedExpenses);
    }

    /**
     * Get planned_expenses
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getPlannedExpenses()
    {
        return $this->planned_expenses;
    }
}
